class Container{
  constructor(value) {
    this._value = value;
  }
  map(fn){
    return new Container(fn(this._value))
  }
  static of(value){
    return new Container(value)
  }
}

class Maybe{
  constructor(value) {
    this._value = value;
  }
  map(fn){
    return new Maybe(this.isNull()?this._value:fn(this._value))
  }
  static of(value){
    return new Maybe(value)
  }
  isNull(){
    return !this._value
  }
}

module.exports={Container,Maybe}